package com.smart.enums;

public enum SaveOrUpdateEnum {
    SAVE("1","新增"),
    UPDATE("2","更新");

    private String code;
    private String name;
    SaveOrUpdateEnum(String code, String name){
        this.code = code;
        this.name = name;
    }

    public static String getName(String code){
        for (SaveOrUpdateEnum obj : SaveOrUpdateEnum.values()) {
            if(obj.getCode().equals(code)){
                return obj.getName();
            }
        }
        return "";
    }

    public String getName() {
        return name;
    }

    public String getCode() {
        return code;
    }
}
